import Vue from 'vue'
import VueRouter from 'vue-router'
import Comprehensive from '../views/Comprehensive'
import Login from '../components/Login'
import Registry from '../components/Registry'

Vue.use(VueRouter)

const routes = [
  //
  // {
  //   path: '/',
  //   name: 'app',
  //   component: () => import(/* webpackChunkName: "about" */ ),
  // }
  {
    path: '/',
    name: 'app',
    component: Comprehensive,
    children: [
      { path: "login", name: "Login",component: Login},
      { path: "registry", name: "registry",component: Registry},
    ]
  }

]
import Nprogress from 'nprogress'
import 'nprogress/nprogress.css'

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

// 定义跳转虚拟进度条
router.beforeEach((to,from,next) =>{
  Nprogress.start()
  next()
})

router.afterEach((to,from) =>{
  Nprogress.done()
})

export default router
